package _04Dom4j.XPath_Absolute;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;

import java.util.List;

public class DemoXPath {
    public static void main(String[] args) throws DocumentException {
        SAXReader saxReader = new SAXReader();
        Document document = saxReader.read("day14\\src\\_04Dom4j\\XPath_Absolute\\xpath_contact.xml");
        List<Node> contactList = document.selectNodes("contactList/contact/name");
        for (Node node : contactList) {
            System.out.println("node.getName() = " + node.getText());
        }


    }
}
